/**
 * 
 */

/**
 * 刷新列表
 */
function refreshBlogTable(path,page,title){
	$.ajax({   
		type : "POST", 
		url : path+"/blog_own.action",
		data:{ 
			title:title,
			page:page
		},
		dataType : 'json', 
		success : function(result) {
			
			initPage(path,page,result.pageBean.totalPages);
			var data=result.data;
			for(var i=0;i<data.length;i++){   
				var $e=$('<tr> <td> <input type="checkbox" name="abc" value="'+data[i].uuid+'"></td><td >'+data[i].title+'</td><td >'+data[i].createTime+'</td><td><a href="#" class="btn btn-primary">查看</a>|	<a href="#">编辑</a>|	<a href="#">删除</a></td></tr>');
				$('#myblog_list_tbody').append($e);
			}
		} 
	});
}

/**
 * 初始化分页插件
 * @param curPage
 * @param totalPages 
 */
function initPage(path,curPage,totalPages){
	
	if(totalPages==0){
		totalPages=1; 
	}
	
	var options = {
			currentPage : curPage,
			totalPages : totalPages,
			numberOfPages : 5,  
			size:"normal",
			alignment:"right",  
			/*pageUrl : function(type, page, current) { 
				return path + "/blog_blogList.action?rows=10&page=" + page;
			}*/
			onPageClicked: function(e,originalEvent,type,page){
				refreshBlogListUL(path,page);
            }
		}
		$('#page1').bootstrapPaginator(options);
}
